package com.xfcy.blog.dto;

import com.xfcy.blog.valid.AddGroup;
import com.xfcy.blog.valid.ListValue;
import com.xfcy.blog.valid.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * @author 晓风残月Lx
 * @date 2023/5/19 17:08
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SystemUserDTO {


    private Integer id;

    @ApiModelProperty(value = "账号")
    @NotBlank(message = "邮箱不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Email(message = "邮箱必须是一个合法的邮箱地址" ,groups = {AddGroup.class, UpdateGroup.class})
    private String username;

    @ApiModelProperty(value = "昵称")
    private String nickname;

    @ApiModelProperty(value = "密码")
    @Length(min = 6, message = "密码不能小于6位", groups = {AddGroup.class, UpdateGroup.class})
    @NotBlank(message = "密码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String password;

    @ApiModelProperty(value = "旧密码")
    @Length(min = 6, message = "密码不能小于6位", groups = {UpdateGroup.class})
    @NotBlank(message = "密码不能为空", groups = {UpdateGroup.class})
    private String pwd;

    @ApiModelProperty(value = "头像")
    private String avatar;

    @ApiModelProperty(value = "状态")
    @ListValue(vals = {0,1}, groups = {UpdateGroup.class,AddGroup.class})
    private Integer status;

    @ApiModelProperty(value = "角色Id")
    private Integer roleId;

    @ApiModelProperty(value = "删除的图片")
    private List<String> deleteAvatar;
}
